package com.sinosoft.bee.services.provider.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author:TobbyQuinn
 * @date:2018/4/24
 * @project:bee
 **/
@RestController
public class ProviderDemo {
    @Value("${spring.profiles}")
    private String profiles;

    @GetMapping("/provider/{id}")
    public ResultVO getMsgFromProvider(@PathVariable long id){
        ResultVO resultVO = new ResultVO();
        resultVO.setMessage("provider_"+profiles+"_"+id);
        return resultVO;

    }

    @PostMapping("/provider2")
    public ResultVO getMsgFromProvider2( @RequestBody Map<String,String> map){
        ResultVO resultVO = new ResultVO();
        resultVO.setMessage("provider_"+profiles+"_"+map.get("id"));
        return resultVO;

    }


}
